<template>
  <div class="information">
    <h3>最新资讯</h3>
    <div v-for="item in area" :key="item.id" class="inform-box">
      <img :src="'http://www.xiaoshuaipeng.com:8080' + item.imgSrc" alt="" />
      <div class="inform-right">
        <h4>{{ item.title }}</h4>
        <p>
          <span>{{ item.from }}</span>
          <span>{{ item.date }}</span>
        </p>
      </div>
    </div>
  </div>
</template>

<script>
import axios from "axios";
export default {
  name: "InformMation",
  props: {},
  data() {
    return {
      area: [],
    };
  },
  created() {
    this.zix();
  },
  methods: {
    async zix() {
      const zi = await axios.get(
        "http://www.xiaoshuaipeng.com:8080/home/news?area=AREA%7C88cff55c-aaa4-e2e0"
      );
      //   console.log(zi.data.body);
      this.area = zi.data.body;
    },
  },
};
</script>

<style scoped lang="less">
.information {
  margin-top: 10px;
  background-color: #fff;
  padding: 0px;
  h3 {
    padding: 10px;
  }
  .inform-box {
    height: 100px;
    display: flex;
    justify-content: space-between;
    align-items: stretch;
    padding: 10px;
  }
  .inform-right {
    padding-left: 10px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    p {
      display: flex;
      // justify-content: ;
      // align-items: s;
      justify-content: space-between;
    }
  }
  img {
    width: 100px;
    height: 100px;
  }
}
</style>
